
var initShopAreaInfoBean;
var getShopAreaInfoBeanFromOpenPage = function(){
	var shopareainfoBean = {};
	shopareainfoBean.id = jQuery('#idEditor').val();
	
	
	shopareainfoBean.areaId = jQuery('#areaIdEditor').val();
	
	if(!shopareainfoBean.areaId){
		$.ligerDialog.error("请输入社区!");
		return null;
	}	shopareainfoBean.shopId = jQuery('#shopIdEditor').val();
	
	if(!shopareainfoBean.shopId){
		$.ligerDialog.error("请输入商户!");
		return null;
	}	shopareainfoBean.goodsClassifyId = jQuery('#goodsClassifyIdEditor').val();
	
	if(!shopareainfoBean.goodsClassifyId){
		$.ligerDialog.error("请输入商品类型!");
		return null;
	}	shopareainfoBean.num = jQuery('#numEditor').val();
	
	if(!shopareainfoBean.num){
		$.ligerDialog.error("请输入数量上限!");
		return null;
	}	
	return shopareainfoBean;
};

var initShopAreaInfoPage = function(){
	
	
	
	
	
};

var bindShopAreaInfoUpdateButtom = function(){
	jQuery('#updateEdit').unbind('click').click(function(){
		var shopareainfoBean = getShopAreaInfoBeanFromOpenPage();
		if(null != shopareainfoBean){
			doSaveShopAreaInfos([shopareainfoBean]);
		}
	});
};
var bindShopAreaInfoResetButtom = function(){
	jQuery('#resetEdit').unbind('click').click(function(){
		if(!initShopAreaInfoBean){
			jQuery("#areaIdEditor").val('');
			jQuery("#shopIdEditor").val('');
			jQuery("#goodsClassifyIdEditor").val('');
			jQuery("#numEditor").val('');
		}else{
			if(!initShopAreaInfoBean.areaId){
				jQuery("#areaIdEditor").val('');
			}else{
				jQuery("#areaIdEditor").val(initShopAreaInfoBean.areaId);
			}
			if(!initShopAreaInfoBean.shopId){
				jQuery("#shopIdEditor").val('');
			}else{
				jQuery("#shopIdEditor").val(initShopAreaInfoBean.shopId);
			}
			if(!initShopAreaInfoBean.goodsClassifyId){
				jQuery("#goodsClassifyIdEditor").val('');
			}else{
				jQuery("#goodsClassifyIdEditor").val(initShopAreaInfoBean.goodsClassifyId);
			}
			if(!initShopAreaInfoBean.num){
				jQuery("#numEditor").val('');
			}else{
				jQuery("#numEditor").val(initShopAreaInfoBean.num);
			}
		}
	});
};



jQuery(function(){
	initShopAreaInfoPage();
	bindShopAreaInfoUpdateButtom();
	bindShopAreaInfoResetButtom();
});